import utils from '../../core/utils';
import { appInfo } from '../apis/appInfo';
import { taskStatus } from '../enums/taskStatus';

export class downloadInfo {
  constructor(id?: number, app?: appInfo, filePath?: string) {
    this.downloadId = id;
    if (!utils.isEmpty(app)) {
      this.appId = app.id;
      this.appIcon = app.icon;
      this.appName = app.name;
      this.appVer = app.version;
      this.status = taskStatus.running;
      this.packageName = app.packageName;
    }
    if (!utils.isEmpty(filePath))
      this.filePath = filePath;
  }

  appId: string;
  appIcon: string;
  appName: string;
  status: number;
  appVer: string;
  filePath: string;
  packageName: string;
  downloadId: number;
}